package com.qf.smartplatform.mapper;

import com.qf.smartplatform.pojo.SysUserOnline;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OnlineUserMapper {
    @Insert("insert into sys_user_online values (#{sessionId},#{loginName},#{ipaddr},#{loginLocation},#{browser},#{os},#{status},#{startTimestamp},#{lastAccessTime},#{expireTime})")
    void addOnlineData(SysUserOnline sysUserOnline);
    @Select("select login_name from sys_user_online where login_name=#{loginName}")
    String dataExist(String loginName);
    @Update("UPDATE sys_user_online SET sessionId=#{sessionId},ipaddr=#{ipaddr},login_location=#{loginLocation},browser=#{browser},os=#{os},status=#{status},last_access_time=start_timestamp,start_timestamp=#{startTimestamp},expire_time=#{expireTime} WHERE login_name =#{loginName}")
    void updateOnlineData(SysUserOnline sysUserOnline);
}
